﻿<UserControl x:Class="ContactTracing.CaseView.Controls.ExportCsvFile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:p="clr-namespace:ContactTracing.CaseView.Properties"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
        <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}">
            <StackPanel Margin="40, 20, 40, 20" MinWidth="500">

                <StackPanel>
                    <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                    <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="EXPORTING DATA"/>
                </StackPanel>

                <StackPanel Height="10" />

                <StackPanel Visibility="{Binding IsExportingData, Converter={StaticResource BooleanToVisibilityConverter}}" >
                    <ProgressBar Width="500" HorizontalAlignment="Stretch" Height="16" Foreground="#558FFF" Minimum="0" Maximum="1" Value="{Binding TaskbarProgressValue, FallbackValue=0}" />
                    <StackPanel Height="4" />
                    <TextBlock Text="{Binding SyncStatus, FallbackValue=...}" />
                    <StackPanel Height="4" />
                </StackPanel>

                <StackPanel Visibility="{Binding IsExportingData, Converter={StaticResource BooleanToCollapsedConverter}}" >

                    <Grid>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>

                        <Grid Grid.Column="0" VerticalAlignment="Top" Visibility="{Binding HasExportErrors, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}">
                            <Ellipse Grid.Column="0" Fill="Red"  Width="24" Height="24" />
                            <Path  Stretch="Fill" Height="14" Width="14" Fill="White" Data="F1 M 26.9166,22.1667L 37.9999,33.25L 49.0832,22.1668L 53.8332,26.9168L 42.7499,38L 53.8332,49.0834L 49.0833,53.8334L 37.9999,42.75L 26.9166,53.8334L 22.1666,49.0833L 33.25,38L 22.1667,26.9167L 26.9166,22.1667 Z " />
                        </Grid>

                        <Grid Grid.Column="0" VerticalAlignment="Top" Visibility="{Binding HasExportErrors, Converter={StaticResource BooleanToCollapsedConverter}, FallbackValue=Visible}">
                            <Ellipse Grid.Column="0" Fill="Green"  Width="24" Height="24" />
                            <Path  Stretch="Fill" Height="14" Width="14" Fill="White" Data="F1 M 23.7501,33.25L 34.8334,44.3333L 52.2499,22.1668L 56.9999,26.9168L 34.8334,53.8333L 19.0001,38L 23.7501,33.25 Z" />
                        </Grid>

                        <StackPanel Grid.Column="2" VerticalAlignment="Top">
                            <TextBlock Text="{Binding SyncStatus, FallbackValue='...'}" FontWeight="SemiBold" FontSize="14" />

                            <StackPanel Height="8" />

                            <!--<TextBlock Text="{Binding TimeElapsed, FallbackValue='...'}" />

                            <StackPanel Height="4" />-->

                            <!--<TextBlock Text="{Binding SyncStatus, FallbackValue='...'}" />-->
                        </StackPanel>

                    </Grid>

                    <Button Width="90" Margin="4, 4, 0, 0" 
                                HorizontalAlignment="Right"
                                x:Name="panelDataExportOKButton" IsEnabled="{Binding IsExportingData, Converter={StaticResource BooleanInverter}}" 
                        Visibility="{Binding IsExportingData, Converter={StaticResource BooleanToCollapsedConverter}}" 
                                Command="{Binding HideDataExportCommand}"
                                Content="{x:Static p:Resources.Close}" />
                </StackPanel>
            </StackPanel>
        </Border>
    </DockPanel>
</UserControl>
